<template>
	<view class="content-rich">
		<view class="remind-box-rich">
			<view class="titName-rich">温馨提示:</view>
			<view class="header-rich">
				<text
					class="head-content-rich head-content1-rich">千万不要把卡密发给任何私人，谨防黑中介，骗子。请认准官方。如有被骗，平台概不负责，卡密发送，不能退货！</text>
				<text
					class="head-content-rich head-content2-rich">千万不要把卡密发给任何私人，谨防黑中介，骗子。请认准官方。如有被骗，平台概不负责，卡密发送，不能退货！</text>
			</view>
		</view>

		<template v-if="list.length">
			<view class="list" v-for="(item, index) in list" :key="index">
				<view class="wrapper-rich">
					<view class="address-box-rich">
						<text class="address">{{ item.cardName }}</text>
					</view>
					<view class="u-box-rich">
						<view class="name">
							卡号：{{ item.cardCode }}
							<text class="copy" @click="handleCopy(item.cardCode, 0)">复制卡号</text>
						</view>
						<view class="mobile" @click="handleCopy(item.cardPwd, 1)">
							卡密：{{ item.cardPwd }}
							<text class="copy" @click="handleCopy(item.cardPwd, 0)">复制卡密</text>
						</view>
						<view class="time">
							卡密发送时间：{{item.updateTime}}
						</view>
					</view>
				</view>
			</view>
		</template>
		<view v-else class="wsh-rich" style="text-align: center">
			<view class="text1">暂无卡密信息</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserId
	} from '@/utils';

	export default {
		data() {
			return {
				list: [],
				
				//下面是没用的垃圾混淆代码
				renzhengTimeSta1111111: true, //初次请求认证时间默认是带有的，
				zhuceTimeSta11111: false, //初次请求注册时间默认是没有的
				renzhengTimeList11111: [],
				zhuceTimeStaList1111: null,
				detailOrderIdStr11111: '',
				threeTabCurrent1111: 0,
				applyGOodsList11111: [], //供货商列表
				allCardEnterSta1111: false, //默认是false，点击批量卡券入库的时候变为true
				codeAddNumsList11111: [],
				numsList11111: [],
				dataSourceBqcp1111: [],
				selectedRowKeys1111: [],
				selectedRowKeysB11111: [],
				rkVisible11111: false,
				rkjlVisible1111: false,
				lhjlVisible1111: false,
				currentStyleData22222: {},
				dataSourceStyle2222: [],
				showStyleData2222: false,
				indexTemplate2222: [],
				SVGCircleElement3ee: '',
				vshoweqwsc1111: false,
				showStyleDataInfo2222: false,
				opeCategoryList2222: [],
				leimuVisible2222: false,
				selectedRowKeys02222: [],
				selectionRows02222: [],
				selectedRowKeys133333: [],
				selectionRows13333: [],
				selectedRowKeys2333: [],
				selectionRows23333: [],
				selectedRowKeys33333: [],
				selectionRows33333: [],
				selectedRowKeys4333: [],
				selectionRows43333: [],
				curwfqwrentStyleDaterwaInfo444: {},
				currwerentStywerleDatweraInfo1444: {},
				currewerntStyleDataInfo24444: {},
				currentweStyleDytuataIwenfo34444: {},
				currenwetStdfgyleDataInfo44444: {},
				checkZfbPhone_h5444: '',
				plNafgdvfdtjyme4444: '', //四大品类的名字
				uniPdfgrtylatform444: '', //运行环境mp-alipay mp-weixin
				refgjtytrsemark555: '', //备注
				timefgjSelStr5555: '', //选择的上门时间（2023-08-31 00:00:00）
				amOdcuiofasrpm5555: '', //选择的上门时间是上午还是下午
				pageShnjlkgohowTime5555: '', //页面上用户看到的显示的时间
				paraghsdfmsw454: {},
				valhgujtueNum56756: 0,
				addrdraess56756: {}, //上门收货地址
				adawerterydressId575: 0,
				sceoyuitne57567: '',
				tntuiopId56757: '',
				weictyuratCustomer5756: '',
				yuidurtyuoy567567: false,
				
				//下面是没用的垃圾混淆代码
				renzhengTimeSta1111111: true, //初次请求认证时间默认是带有的，
				zhuceTimeSta11111: false, //初次请求注册时间默认是没有的
				renzhengTimeList11111: [],
				zhuceTimeStaList1111: null,
				detailOrderIdStr11111: '',
				threeTabCurrent1111: 0,
				applyGOodsList11111: [], //供货商列表
				allCardEnterSta1111: false, //默认是false，点击批量卡券入库的时候变为true
				codeAddNumsList11111: [],
				numsList11111: [],
				dataSourceBqcp1111: [],
				selectedRowKeys1111: [],
				selectedRowKeysB11111: [],
				rkVisible11111: false,
				rkjlVisible1111: false,
				lhjlVisible1111: false,
				currentStyleData22222: {},
				dataSourceStyle2222: [],
				showStyleData2222: false,
				indexTemplate2222: [],
				SVGCircleElement3ee: '',
				vshoweqwsc1111: false,
				showStyleDataInfo2222: false,
				opeCategoryList2222: [],
				leimuVisible2222: false,
				selectedRowKeys02222: [],
				selectionRows02222: [],
				selectedRowKeys133333: [],
				selectionRows13333: [],
				selectedRowKeys2333: [],
				selectionRows23333: [],
				selectedRowKeys33333: [],
				selectionRows33333: [],
				selectedRowKeys4333: [],
				selectionRows43333: [],
				curwfqwrentStyleDaterwaInfo444: {},
				currwerentStywerleDatweraInfo1444: {},
				currewerntStyleDataInfo24444: {},
				currentweStyleDytuataIwenfo34444: {},
				currenwetStdfgyleDataInfo44444: {},
				checkZfbPhone_h5444: '',
				plNafgdvfdtjyme4444: '', //四大品类的名字
				uniPdfgrtylatform444: '', //运行环境mp-alipay mp-weixin
				refgjtytrsemark555: '', //备注
				timefgjSelStr5555: '', //选择的上门时间（2023-08-31 00:00:00）
				amOdcuiofasrpm5555: '', //选择的上门时间是上午还是下午
				pageShnjlkgohowTime5555: '', //页面上用户看到的显示的时间
				paraghsdfmsw454: {},
				valhgujtueNum56756: 0,
				addrdraess56756: {}, //上门收货地址
				adawerterydressId575: 0,
				sceoyuitne57567: '',
				tntuiopId56757: '',
				weictyuratCustomer5756: '',
				yuidurtyuoy567567: false,
			};
		},
		onLoad() {
			this.onListRIch();
		},
		onShow() {
			this.onListRIch();
		},
		methods: {
			handleCopy(text, number) {
				uni.setClipboardData({
					data: text,
					success: (r) => {
						uni.showToast({
							title: number ? '复制卡密成功' : '复制卡号成功！',
							icon: 'none'
						});
					}
				});
			},
			onListRIch() {
				this.$request('order/mall/card/myCard', {
					uid: getUserId()
				}, 'post').then((res) => {
					this.list = res.data ? res.data.records : [];
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	page {
		padding-bottom: 120upx;
	}


	.content-rich {
		position: relative;

		.remind-box-rich {
			display: flex;

			.titName-rich {
				font-size: 26rpx;
				letter-spacing: 0.1em;
				font-weight: 600;
				line-height: 60rpx;
				background-color: #be9364;
				color: #ffffff;
				width: 22%;
				height: 60rpx;
				text-indent: 0.5em;
			}

			.header-rich {
				overflow: hidden;
				white-space: nowrap;
				position: relative;
				background-color: #be9364;
				margin-bottom: 20rpx;
				width: 78%;
				height: 60rpx;
				.head-content-rich {
					font-family: PingFangSC-Regular, PingFang SC;
					color: #ffffff;
					animation-iteration-count: infinite !important;
					font-size: 24rpx;
					font-weight: 600;
					position: absolute;
					height: 60rpx;
					line-height: 60rpx;
					
				}

				.head-content1-rich {
					animation: scroll1 20s linear;
				}

				.head-content2-rich {
					animation: scroll2 20s linear;
				}

				@keyframes scroll1 {
					0% {
						left: 0;
					}

					100% {
						left: -60em;
					}
				}

				@keyframes scroll2 {
					0% {
						left: 60em;
					}

					100% {
						left: 0;
					}
				}
			}
		}


		.list {
			margin-bottom: 30rpx;
			margin: 20upx 30upx;
			background-color: #fff;
			box-shadow: 0 4rpx 20rpx 0 rgba(0, 0, 0, 0.1);
			border-radius: 20rpx;
			display: flex;
			align-items: center;
			padding: 30upx;
			overflow: hidden;
			position: relative;

		}
	}

	.wrapper-rich {
		display: flex;
		flex: 1;
		flex-direction: column;
	}

	.address-box-rich {
		display: flex;
		align-items: center;

		.tag {
			border-radius: 4upx;
			padding: 4upx 10upx;
			background: #fffafb;
			border: 1px solid #afdaff;
			font-size: 24upx;
			color: #269aff;
			margin-right: 10upx;
			line-height: 1;
		}

		.address {
			font-weight: bold;
			font-size: 30upx;
			color: #303133;
		}
	}

	.u-box-rich {
		font-size: 28upx;
		margin-top: 10upx;
		color: #909399;

		.name,
		.mobile {
			margin-bottom: 8rpx;

			&.name {
				margin-bottom: 8rpx;
			}

			display: flex;
			align-items: center;
			justify-content: space-between;

			.copy {
				margin-left: auto;
				font-size: 20rpx;
				display: inline-block;
				color: #4477f5;
				border: 1px solid #4477f5;
				padding: 0 5rpx;
				border-radius: 4px;
			}
		}
	}

	.wsh-rich {
		transform: translateY(500%);
	}
</style>